<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
  <script type="text/javascript" src="../script/jquery-3.7.1.min.js"></script>
  <script type="text/javascript">
    $(function (){
      $("button").click(function (){
        //图片切换
        if ($("img").attr("src")=="./image/2.png"){
          $("img").attr("src","./image/3.png")
          $("img").attr("height","241")
          $("img").attr("width","316")
        }
        else{
          $("img").attr("src","./image/2.png")
          $("img").attr("height","241")
          $("img").attr("width","316")
        }
      })
    })
  </script>
</head>
<body>
<img src="../image/2.png" height="241" width="316"></img>
<br>
<button>点击更改图片</button>
</body>
</html>